<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BinaryTree: BinaryTree&lt; Comparable &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BinaryTree
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Logical design of binary trees and nodes.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="class_binary_tree-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">BinaryTree&lt; Comparable &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Base class for trees.  
 <a href="class_binary_tree.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_binary_tree_8h_source.html">BinaryTree.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BinaryTree&lt; Comparable &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="class_binary_tree__inherit__graph.gif" border="0" usemap="#_binary_tree_3_01_comparable_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="_binary_tree_3_01_comparable_01_4_inherit__map" id="_binary_tree_3_01_comparable_01_4_inherit__map">
<area shape="rect" title="Base class for trees." alt="" coords="103,5,303,185"/>
<area shape="rect" href="class_bst_tree.html" title="A binary search tree." alt="" coords="114,233,293,399"/>
<area shape="rect" href="class_avl_tree.html" title="An Avltree." alt="" coords="5,447,188,671"/>
<area shape="rect" href="class_splay_tree.html" title="A splaytree." alt="" coords="213,461,407,656"/>
</map>
</div>
<div class="dynheader">
Collaboration diagram for BinaryTree&lt; Comparable &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="class_binary_tree__coll__graph.gif" border="0" usemap="#_binary_tree_3_01_comparable_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="_binary_tree_3_01_comparable_01_4_coll__map" id="_binary_tree_3_01_comparable_01_4_coll__map">
<area shape="rect" title="Base class for trees." alt="" coords="5,175,205,355"/>
<area shape="rect" href="struct_binary_tree_1_1_node.html" title="Basis struct for all nodes." alt="" coords="13,5,198,112"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_binary_tree_1_1_node.html">Node</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Basis struct for all nodes.  <a href="struct_binary_tree_1_1_node.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a48948ead687bb359964378fc9f96e962"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#a48948ead687bb359964378fc9f96e962">BinaryTree</a> ()</td></tr>
<tr class="separator:a48948ead687bb359964378fc9f96e962"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb2c568c63382a2f67f6f0de2a3113e7"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#afb2c568c63382a2f67f6f0de2a3113e7">~BinaryTree</a> ()</td></tr>
<tr class="separator:afb2c568c63382a2f67f6f0de2a3113e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ed034626b76cf27efe77bce17604bc4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#a2ed034626b76cf27efe77bce17604bc4">printTree</a> (ostream &amp;out=cout) const</td></tr>
<tr class="separator:a2ed034626b76cf27efe77bce17604bc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af1cb2a82a7837713d1d0e71cd90a76a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#af1cb2a82a7837713d1d0e71cd90a76a0">makeEmpty</a> ()</td></tr>
<tr class="separator:af1cb2a82a7837713d1d0e71cd90a76a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af588056c5cd620cdb6b66e7db4e706b8"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#af588056c5cd620cdb6b66e7db4e706b8">insert</a> (const Comparable &amp;x)</td></tr>
<tr class="separator:af588056c5cd620cdb6b66e7db4e706b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee7222ca2a42b69a5703eb8f77ee2842"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#aee7222ca2a42b69a5703eb8f77ee2842">insert</a> (Comparable &amp;&amp;x)</td></tr>
<tr class="separator:aee7222ca2a42b69a5703eb8f77ee2842"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fe5e6e0b3266169eaaf8e16997c804e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#a1fe5e6e0b3266169eaaf8e16997c804e">remove</a> (const Comparable &amp;x)</td></tr>
<tr class="separator:a1fe5e6e0b3266169eaaf8e16997c804e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacd21ed74feac2218b95bea652f9f399"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#aacd21ed74feac2218b95bea652f9f399">remove</a> (Comparable &amp;&amp;x)</td></tr>
<tr class="separator:aacd21ed74feac2218b95bea652f9f399"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a5f3b3e7aab67967fe53c46f532fb311c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_binary_tree_1_1_node.html">Node</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_binary_tree.html#a5f3b3e7aab67967fe53c46f532fb311c">root</a> = nullptr</td></tr>
<tr class="separator:a5f3b3e7aab67967fe53c46f532fb311c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Comparable&gt;<br />
class BinaryTree&lt; Comparable &gt;</h3>

<p>Base class for trees. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Comparable</td><td></td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a48948ead687bb359964378fc9f96e962"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48948ead687bb359964378fc9f96e962">&#9670;&nbsp;</a></span>BinaryTree()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::<a class="el" href="class_binary_tree.html">BinaryTree</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a new Binary Tree object </p>

</div>
</div>
<a id="afb2c568c63382a2f67f6f0de2a3113e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb2c568c63382a2f67f6f0de2a3113e7">&#9670;&nbsp;</a></span>~BinaryTree()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::~<a class="el" href="class_binary_tree.html">BinaryTree</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destructor for the tree </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aee7222ca2a42b69a5703eb8f77ee2842"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee7222ca2a42b69a5703eb8f77ee2842">&#9670;&nbsp;</a></span>insert() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::insert </td>
          <td>(</td>
          <td class="paramtype">Comparable &amp;&amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reimplemented in <a class="el" href="class_splay_tree.html#adde9d24f5ea5c441e0cee83cce7afedd">SplayTree&lt; Comparable &gt;</a>, <a class="el" href="class_avl_tree.html#ad9feb22f565e013c60176ab0dc7adba4">AvlTree&lt; Comparable &gt;</a>, and <a class="el" href="class_bst_tree.html#ad1fd360ecaf13dd46d1b3e4030647af1">BstTree&lt; Comparable &gt;</a>.</p>

</div>
</div>
<a id="af588056c5cd620cdb6b66e7db4e706b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af588056c5cd620cdb6b66e7db4e706b8">&#9670;&nbsp;</a></span>insert() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::insert </td>
          <td>(</td>
          <td class="paramtype">const Comparable &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Insert x into the tree; duplicates are ignored. </p>

<p>Reimplemented in <a class="el" href="class_splay_tree.html#a8aee728cd2536dc8306129fa64c1f694">SplayTree&lt; Comparable &gt;</a>, <a class="el" href="class_avl_tree.html#aff480dbd38c3803011882dab799871dc">AvlTree&lt; Comparable &gt;</a>, and <a class="el" href="class_bst_tree.html#a8c92bedb44279045795259b36031c725">BstTree&lt; Comparable &gt;</a>.</p>

</div>
</div>
<a id="af1cb2a82a7837713d1d0e71cd90a76a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af1cb2a82a7837713d1d0e71cd90a76a0">&#9670;&nbsp;</a></span>makeEmpty()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::makeEmpty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Make the tree logically empty. </p>

</div>
</div>
<a id="a2ed034626b76cf27efe77bce17604bc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ed034626b76cf27efe77bce17604bc4">&#9670;&nbsp;</a></span>printTree()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::printTree </td>
          <td>(</td>
          <td class="paramtype">ostream &amp;&#160;</td>
          <td class="paramname"><em>out</em> = <code>cout</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Print the tree contents. </p>

</div>
</div>
<a id="aacd21ed74feac2218b95bea652f9f399"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aacd21ed74feac2218b95bea652f9f399">&#9670;&nbsp;</a></span>remove() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::remove </td>
          <td>(</td>
          <td class="paramtype">Comparable &amp;&amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reimplemented in <a class="el" href="class_splay_tree.html#af020a5b6cf5934071739aad949802edd">SplayTree&lt; Comparable &gt;</a>, <a class="el" href="class_avl_tree.html#ab79e0850047dec805260735bb35d1b51">AvlTree&lt; Comparable &gt;</a>, and <a class="el" href="class_bst_tree.html#a0251edb51327b40d42e576c885c24334">BstTree&lt; Comparable &gt;</a>.</p>

</div>
</div>
<a id="a1fe5e6e0b3266169eaaf8e16997c804e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fe5e6e0b3266169eaaf8e16997c804e">&#9670;&nbsp;</a></span>remove() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::remove </td>
          <td>(</td>
          <td class="paramtype">const Comparable &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Remove x from the tree. Nothing is done if x is not found. </p>

<p>Reimplemented in <a class="el" href="class_splay_tree.html#a4dfaad055380b8384d9365823e224bf0">SplayTree&lt; Comparable &gt;</a>, <a class="el" href="class_avl_tree.html#af87eb93a5639ae6d3661ce1c93680e14">AvlTree&lt; Comparable &gt;</a>, and <a class="el" href="class_bst_tree.html#a7cb0b1bd945708ccf9e4af1905b6ac95">BstTree&lt; Comparable &gt;</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a5f3b3e7aab67967fe53c46f532fb311c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f3b3e7aab67967fe53c46f532fb311c">&#9670;&nbsp;</a></span>root</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_binary_tree_1_1_node.html">Node</a>* <a class="el" href="class_binary_tree.html">BinaryTree</a>&lt; Comparable &gt;::root = nullptr</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_binary_tree_8h_source.html">BinaryTree.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
